local extension = Package:new("other")
extension.extensionName = "Euphonium"
local U = require "packages/utility/utility"
Fk:loadTranslationTable{
    ["other"] = "其他",
}
local huihui = General:new(extension,"huihui","th_k_chui1",3,3,General.Female)
local baolie = fk.CreateTriggerSkill{
    name = "baolie",
    anim_type = "offensive",
    events = {fk.TargetSpecified},
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(self) and data.to ~= player.id
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local to = room:getPlayerById(data.to)
        room:addPlayerMark(to, "@baolie")
        room:addPlayerMark(player,"@wuxia")
    end,
  }
  local baolie_trigger = fk.CreateTriggerSkill{
    name = "#baolie_trigger",
    events = {fk.DamageCaused},
    can_trigger = function(self, event, target, player, data)
      return target == player and data.to ~= player and data.to:getMark("@baolie") > 0
    end,
    on_use = function(self, event, target, player, data)
      local room = player.room
      local to = data.to
      local n = to:getMark("@baolie")
      player:turnOver()
      room:removePlayerMark(player,"@wuxia",n)
      room:removePlayerMark(to,"@baolie",n)
      data.damage = data.damage + n
    end
  }
  local wuxia = fk.CreateTriggerSkill{
    name = "wuxia",
    anim_type = "drawcard",
    events = {fk.EventPhaseStart},
    can_trigger = function(self, event, target, player, data)
      return target == player and player:hasSkill(self) and player.phase == Player.Draw
    end,
    on_use = function(self, event, target, player, data)
        local n = math.min(player:getMark("@wuxia"), 5)
        if n > 0 then
            player:drawCards(n, self.name)
            if player.dead or player:isKongcheng() then return true end
            end
        return true
    end,
  }
  local hongmo = fk.CreateTriggerSkill{
    name = "hongmo",
    anim_type = "drawcard",
    events = {fk.DrawNCards},
    on_use = function(self, event, target, player, data)
      data.n = data.n + 1
    end,
  }
  local hongmo_maxcards = fk.CreateMaxCardsSkill{--手牌上限
    name = "#hongmo_maxcards",
    correct_func = function(self, player)
      if player:hasSkill(hongmo.name) then
        return 2
      end
    end
  }
  huihui:addSkill(baolie)
  baolie:addRelatedSkill(baolie_trigger)
  huihui:addSkill(wuxia)
  huihui:addSkill(hongmo)
  hongmo:addRelatedSkill(hongmo_maxcards)
  Fk:loadTranslationTable{
    ["huihui"] = "惠惠",
    ["#huihui"] = "爆裂魔法使",
    ["baolie"] = "爆裂",
    [":baolie"] = "当你使用牌指定其他角色为目标后，你可以令其获得一个“爆裂”标记。当你造成伤害时，若目标有“ 爆裂”，你可以翻面，并移除其所有“爆裂”标记令此伤害加x ( x为移除标记数)。",
    ["@baolie"] = "爆裂",
    ["@wuxia"] = "无暇",
    ["wuxia"] = "无暇",
    [":wuxia"] = "摸牌阶段，你可以放弃摸牌改为获得牌堆顶x张牌( x为场上“爆裂”标记数，且至多为5)",
    ["#baolie_trigger"] = "爆裂",
    ["hongmo"] = "红魔",
    [":hongmo"] = "宗族技:摸牌阶段，你额外摸一-张牌。你的手牌上限+2。",
  }
return extension